import Api from "./fetch-axios"
import { BASE_URL } from "../common/const"

import {interestListData, sortData, messageData, VideoListData } from '/mock/index'

const api = new Api(BASE_URL)
const openMock = import.meta.env.DEV && true

export const getFindSortList = (params) => {
    if (openMock) {
        return sortData
    }
    return api.request({
        url: '/find/sortList',
        params
    })
}

export const getInterestList = (params) => {
    if (openMock) {
        return interestListData
    }
    return api.request({
        url: '/find/interestList',
        params,
        method:'post'
    })
}

export const getInterestVideoList = (params) => {
    if (openMock) {
        return VideoListData
    }
    return api.request({
        url: '/video/interestVideoList',
        params,
        method:'post'
    })
}

export const getMessageChatList = (params) => {
    if (openMock) {
       return messageData
    }
    return api.request({
        url: '/message/chatList',
        params,
        method:'post'
    })
}

export const getMessageFriendsList = (params) => {
    return api.request({
        url: '/message/findFriends',
        params,
        method:'post'
    })
}